package com.skywolf.chem.common.excel;


import java.util.ArrayList;
import java.util.List;
import java.util.Map;


public class ExcelTable {

    public    enum ExcelType {XLS, XLSX,CSV}

    List<String> headers;
    List<ExcelRow> rows;


    public ExcelTable(List<Map<String, String>> datas){
        if(datas==null || datas.size()==0)
            throw new  IllegalArgumentException("参数datas不能为空");

        Map<String,String> row=datas.get(0);
        headers=new ArrayList(row.keySet());
        rows=new ArrayList<>();
        for (int i=0;i<datas.size();i++)
            rows.add(new ExcelRow(datas.get(i)));

    }
    public List<String> getHeaders() {
        return headers;
    }

    public List<ExcelRow> getRows() {
        return rows;
    }

}
